import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import path from "path"

import Components from "unplugin-vue-components/vite"
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers"
import WindiCSS from 'vite-plugin-windicss'

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  css: {
    preprocessorOptions: {
      less: {
        modifyVars: {
          hack: `true; @import (reference) '@/assets/antdv/index.less';`,
        },
        javascriptEnabled: true,
      }
    }
  },
  plugins: [
    vue(),
    WindiCSS(),
    Components({
      resolvers: [
        AntDesignVueResolver({
          importStyle: "less"
        })
      ]
    })
  ],
  build: {
    outDir: './dist',
		assetsDir: 'assets',
		assetsInlineLimit: 2048,
		brotliSize: false,
		chunkSizeWarningLimit: 2048,
		cssCodeSplit: true,
		sourcemap: false,
		manifest: false,
  }
})
